local thbattle__lumiya_heian = fk.CreateSkill {

  name = "thbattle__lumiya_heian",

  tags = {},

}



thbattle__lumiya_heian:addEffect("active", {
  name = "thbattle__lumiya_heian",
  anim_type = "offensive",
  prompt = "#thbattle__lumiya_heian",
  no_indicate = true,
  target_num = 2,
  target_filter = function(self, player, to_select, selected, selected_cards, card, extra_data)
    if to_select ~= player then
      if #selected < 1 then
        return true
      elseif #selected == 1 then
        return selected[1] --[[@as Player]]:canUseTo(Fk:cloneCard("slash"), to_select)
      else
        return false
      end
    end
  end,
  card_num = 1,
  max_phase_use_time = 1,
  card_filter = function(self, player, to_select, selected)
    return #selected < 1 and not player:prohibitDiscard(to_select)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target1 = effect.tos[1]
    local target2 = effect.tos[2]
    room:throwCard(effect.cards, thbattle__lumiya_heian.name, player, player)
    room:doIndicate(effect.from, { effect.tos[1] })
    room:doIndicate(effect.tos[1], { effect.tos[2] })
    local use = player.room:askForUseCard(target1, "slash", nil, "#thbattle__lumiya_heian-use::" .. target2.id, true,
      { must_targets = { target2.id } })
    if use then
      room:useCard(use)
    else
      room:damage({
        from = player,
        damage = 1,
        to = target1,
        skillName = thbattle__lumiya_heian.name
      })
    end
  end,
})

return thbattle__lumiya_heian
